package task2;

import java.util.Random;

public class MergeSortApplication {

	static final int ARRAY_SIZE = 500;
	static final int CEILING = 1000;

	public static void main(String[] args) {

		Random r = new Random();

		Integer[] inputData = new Integer[ARRAY_SIZE];

		for (int i = 0; i < ARRAY_SIZE; i++) {
			inputData[i] = Integer.valueOf(r.nextInt(CEILING));
		}

		for (int i = 0; i < ARRAY_SIZE; i++) {
			System.out.print(inputData[i] + " ");
			if (i == ARRAY_SIZE - 1) {
				System.out.println();
			}
		}

		MultiThreadMergeSorter mtms = new MultiThreadMergeSorter();

		Integer[] sortedData = mtms.doMergeSort(inputData);

		for (int i = 0; i < sortedData.length; i++) {
			System.out.print(sortedData[i] + " ");
		}
	}
}
